﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GMS.BIZ;

namespace Web.SetSystem
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            if (((Account)HttpContext.Current.Session["Account"]).RoleCurrent.Equals('a'))
            {
                if (((Admin)Session["Admin"]).TeacherName == "")
                    Response.Redirect("~/Information/TeaInformation.aspx");
                else 
                Response.Redirect("~/setsystem/AdmManage.aspx");
            }
            else if (((Account)HttpContext.Current.Session["Account"]).RoleCurrent.Equals('t') || ((Account)HttpContext.Current.Session["Account"]).RoleCurrent.Equals('c'))
            {

                if (((Account)HttpContext.Current.Session["Account"]).RoleCurrent.Equals('t'))
                {
                    if (((Teacher)Session["Teacher"]).TeacherName == "")
                        Response.Redirect("~/Information/TeaInformation.aspx");
                    else
                        Response.Redirect("~/setsystem/TchManage.aspx");
                }
                else
                {
                    if (((ClassTeacher)Session["ClassTeacher"]).TeacherName == "")
                        Response.Redirect("~/Information/TeaInformation.aspx");
                    else Response.Redirect("~/setsystem/TchManage.aspx");
                }
            }
            else
            {
                if (((Student)Session["Student"]).StudentName == "")
                    Response.Redirect("~/Information/StuInformation.aspx");
                else
                Response.Redirect("~/setsystem/StuManage.aspx");
            }
            
        }
    }
}
